
<link rel="stylesheet" href="../../xtec-resource/css/public/amazeui.css">
<link rel="stylesheet" href="xtec-resource/css/public/machine_type/machine_type.css"/>
<script type="text/javascript" src="xtec-config/js/md5.min.js"></script>
<script type="text/javascript" src="xtec-resource/js/pagination.js"></script>
<script type="text/javascript" src="xtec-resource/js/Machine_type/machineType.js"></script>
<div id="machineTypeVue" class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf" v-html="formatterLang('机器类型')"></div>
                </div>
                <div class="widget-body  widget-body-lg am-fr">
                    <!-- 添加-->
                    <div class="am-u-sm-12 am-u-md-10 am-u-lg-10">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success"
                                            data-am-modal="{target: '#my-add', closeViaDimmer: 0}">
                                        <span class="am-icon-plus"></span><span v-html="formatterLang('新增')"></span></button>
                                </div>
                            </div>
                        </div>
                    </div>


                    <table class="am-table am-table-compact am-table-bordered tpl-table-black ">
                        <thead>
                        <tr>
                            <th v-html="formatterLang('序号')"></th>
                            <th v-html="formatterLang('机器类型名称')"></th>
                            <th v-html="formatterLang('机器类型属性')"></th>
                            <th v-html="formatterLang('刀具数量')"></th>
                            <th v-html="formatterLang('机器类型备注')"></th>
                            <th v-html="formatterLang('图片')"></th>
                            <th v-html="formatterLang('创建时间')"></th>
                            <th v-html="formatterLang('编辑')"></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="(item,index) of dataTable">
                            <td>{{index+1}}</td>
                            <td>{{item.name}}</td>
                            <td class="am-ellipsis">{{item.property}}</td>
                            <td>{{item.tool_count}}</td>
                            <td>{{item.memo}}</td>
                            <td><div class="tpl-table-black-operation">
                                <span class="pic" v-html="formatterLang('添加')"  @click="addPicture(item.id)"></span>
                                |
                                <span class="pic" v-html="formatterLang('查看')"  @click="showPicture(item)"></span>

                            </div></td>
                            <td>{{item.create_time}}</td>
                            <td><div class="tpl-table-black-operation">
                                <a href="javascript:;" @click="editClick(item)">
                                    <i class="am-icon-pencil"></i> <span v-html="formatterLang('编辑')"></span>
                                </a>
                                <a href="javascript:;" class="tpl-table-black-operation-del" @click="deleteClick(item)">
                                    <i class="am-icon-trash"></i><span v-html="formatterLang('删除')"></span>
                                </a>
                            </div></td>
                        </tr>
                        </tbody>
                    </table>
                    <!--编辑-->
                    <div id="my-edit" class="am-modal am-modal-no-btn" tabindex="-1">
                        <div class="am-modal-dialog">
                            <div class="am-modal-hd"><span v-html="formatterLang('编辑')"></span>
                                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                            </div>
                            <div class="am-modal-bd">
                                <form action="" class="am-form am-form-horizontal" @submit.prevent="submitEdit" id="form-with-tooltip">
                                    <fieldset>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型名称')">：</label>
                                            <div class="am-u-sm-10">
                                                <input type="text" class="am-form-field" :value="editRow.name" minlength="1" maxlength="40" required/>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型属性')">：</label>
                                                <div class="am-u-sm-10">
                                                    <input type="text" class="am-form-field" :value="editRow.property"  minlength="1" maxlength="400" required/>
                                                </div>
                                        </div>
                                        <div class="am-form-group">
                                        <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型备注')">：</label>
                                        <div class="am-u-sm-10">
                                            <input type="text" class="am-form-field" :value="editRow.memo"  minlength="1" maxlength="40" required/>
                                        </div>
                                    </div>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('刀具数量')">：</label>
                                            <div class="am-u-sm-10">
                                                <input type="number" class="am-form-field" :value="editRow.tool_count" minlength="0" maxlength="60" required/>
                                            </div>
                                        </div>
                                        <div class="footer">
                                            <button class="am-btn am-btn-primary" type="submit" v-html="formatterLang('提交')"></button>
                                            <button class="am-btn am-btn-default" data-am-modal-close v-html="formatterLang('取消')"></button>
                                        </div>
                                    </fieldset>
                                </form>
                            </div>
                        </div>
                    </div>


                    <!--新增-->
                    <div id="my-add" class="am-modal am-modal-no-btn" tabindex="-1">
                        <div class="am-modal-dialog">
                            <div class="am-modal-hd"><span v-html="formatterLang('添加机器类型')"></span>
                                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                            </div>
                            <div class="am-modal-bd">
                                <form action="" class="am-form am-form-horizontal" id="addFormUser" @submit.prevent="submitAdd">
                                    <fieldset>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型名称')"></label>
                                            <div class="am-u-sm-10">
                                                <input type="text" id="addUser" class="am-form-field" v-model="userContent.name" required/>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型属性')"></label>
                                            <div class="am-u-sm-10">
                                                <input type="text" class="am-form-field" v-model="userContent.property" required/>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('刀具数量')"></label>
                                            <div class="am-u-sm-10">
                                                <input type="text" class="am-form-field" v-model="userContent.tool_count" required/>
                                            </div>
                                        </div>
                                        <div class="am-form-group">
                                            <label for="doc-vld-name" class="am-u-sm-2 am-form-label" v-html="formatterLang('机器类型备注')"></label>
                                            <div class="am-u-sm-10">
                                                <input type="text"  v-model="userContent.memo" required/>
                                            </div>
                                        </div>
                                        <div class="footer">
                                            <button class="am-btn am-btn-primary" type="submit" v-html="formatterLang('提交')"></button>
                                            <button class="am-btn am-btn-default" data-am-modal-close v-html="formatterLang('取消')"></button>
                                        </div>
                                    </fieldset>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="am-form-group">
                    <div class="am-u-lg-3 am-u-lg-offset-1 am-cf">
                        <select id="userSelect" data-am-selected>
                            <option :value=value+1 v-for="(item,value) in select">{{item}}</option>
                        </select>
                    </div>
                    <div class="am-u-lg-8 am-cf">

                        <div class="am-fr" style="margin-right: 10px">
                            <ul class="am-pagination tpl-pagination" id="paginationType">

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div>
        <!--图片浏览-->
        <div class="am-modal am-modal-no-btn" tabindex="-1" id="myPicture">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">图片浏览
                    <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                </div>
                <div class="am-modal-bd">
                    <figure>
                        <img :src="'xtec-resource/images/machine/'+scanMessage.timg"/>
                    </figure>
                    <div><strong>机器类型名称：</strong><span>{{scanMessage.name}}</span></div>
                    <div><strong>机器类型备注：</strong><span>{{scanMessage.memo}}</span></div>
                </div>
            </div>
        </div>
    <form id="form_upload" method="post" enctype="multipart/form-data" style="display:none" >
        <input name="file" type="file" id='file' />
        <input name="tid" type="text" id="tid" />
    </form>
</div>
</div>
<!--编辑-->